package cn.iocoder.yudao.module.infra.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

@AllArgsConstructor
@Getter
public enum SiteStatusEnum {
    OPPORTUNITY(1, "商机"),
    VOID(2, "作废"),
    SIGNED(3, "签约"),
    CONSTRUCTION(4, "施工"),
    LAUNCHED(5, "上线"),
    DEMOLISHED(6, "已拆站"),
    RESOLD(7, "转售"),
    SUSPENDED(8, "暂停");



    private final int code;
    private final String desc;


    private static final Map<Integer, String> descMap = Arrays.stream(values())
            .collect(Collectors.toMap(e -> e.code, e -> e.desc));

    public static String getDescByCode(Integer code) {
        return descMap.getOrDefault(code, "未知类型");
    }


}
